Skip to content

perf: add a persistant systemd DHT node - #34

Open
jaja360 wants to merge 1 commit into
sim590:masterfrom
jaja360:add_systemd_dht
Open

perf: add a persistant systemd DHT node#34
jaja360 wants to merge 1 commit into
sim590:masterfrom
jaja360:add_systemd_dht

Conversation

@jaja360

@jaja360 jaja360 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces significant improvements to how dpaste interacts with OpenDHT, providing a more robust and efficient DHT proxy setup. The main changes include adding support for an optional persistent local OpenDHT proxy via a systemd user unit, updating documentation and configuration to reflect this, and refactoring HTTP client interactions to use a new JSON-based API with base64 encoding. Additionally, installation scripts are updated to install the new systemd unit.

DHT Proxy Integration and Systemd Unit:

  • Added a new dpaste-dhtnode.service systemd user unit to run a persistent local OpenDHT proxy, and updated installation scripts (CMakeLists.txt, Makefile.am) to install this unit. [1] [2] [3] [4]
  • Updated documentation in README.md and doc/dpaste.1 to describe how to enable and use the systemd DHT proxy, and clarified the configuration file's host and port settings. [1] [2]

Configuration and Documentation Updates:

  • Updated config/dpaste.conf to clarify that the host and port refer to the OpenDHT DhtProxyServer endpoint.

Codebase Changes for Proxy Support:

  • Refactored the Bin class in src/bin.cpp/src/bin.h to only start a local DHT node if the proxy is unavailable, avoiding unnecessary node startups. Introduced ensureNodeRunning() and a node_running_ flag. [1] [2] [3] [4] [5]

HTTP Client Refactoring:

  • Rewrote HttpClient in src/http_client.cpp to use a new JSON API for the proxy, including base64 encoding/decoding for data transmission, and improved error handling and compatibility with the proxy server. [1] [2] [3]

These changes collectively improve performance, reliability, and usability for users who wish to run a persistent DHT proxy, and modernize the client-server communication protocol.

@sim590
sim590 self-requested a review September 4, 2026 04:48
@sim590 sim590 added this to the 0.5.0 milestone Sep 4, 2026
@sim590 sim590 linked an issue Sep 4, 2026 that may be closed by this pull request
@sim590 sim590 added the roadmap This issue/PR references an item on the roadmap label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement roadmap This issue/PR references an item on the roadmap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make use of OpenDHT's proxy

2 participants